Ext.user.loginWindow = Ext.extend(Ext.Window, {
    title: 'OA系统登录框',
    width: 400,
    layout: 'column',
	applyTo:'content',
	closeAction:'hide',
	plain: true,
	id:'loginWindow',
	buttons: [{
            text:'登录',type: 'submit',
			handler:function(){
				Ext.getCmp('loginForm').form.submit({
					method: 'POST',
					url:Ext.user.baseUrl + '/Public/checkLogin',
					 waitMsg: '正在登录中，请稍后。。。',
	                 success: function(f, a){
						   location.href= Ext.user.baseUrl;
	                    },
					 failure: function(f,a){
							Ext.MessageBox.show({
								 title: '警告',
								 msg: a.result.info,
								 buttons: Ext.MessageBox.OK,
									 icon:'ext-mb-error'
							});
						}
				});
			}
			
		  },{
           text: '重置',type: 'reset',
           handler: function(){
			   Ext.getCmp('loginForm').form.reset();
            }
    }],
    initComponent: function() {
        this.items = [
            {
                xtype: 'panel',
                title: '',
                columnWidth: 1,
                height: 25,
                border: false
            },
            {
                xtype: 'form',
				id:'loginForm',
                columnWidth: 1,
				monitorValid: true,
                border: false,
                items: [
                    {
                        xtype: 'fieldset',

                        title: '登录信息框',
                        labelStyle: '',
                        labelSeparator: '：',
                        width: 300,
                        style: 'margin:0px auto;margin-bottom:15px;',
                        items: [
                            {
                                xtype: 'textfield',
								allowBlank:false,
								invalidText:'请输入用户名',
								emptyText:'请输入用户名',
								blankText:'aaa',
                                fieldLabel: '用户',
                                anchor: '90%',
                                labelStyle: 'margin-bottom:10px;',
                                name: 'account'
                            },
                            {
                                xtype: 'textfield',
                                fieldLabel: '密码',
								allowBlank:false,
                                anchor: '90%',
                                labelStyle: 'margin-bottom:10px;',
                                name: 'password',
                                inputType: 'password'
                            }
                        ]
                    }
                ]
            }
        ];
        Ext.user.loginWindow.superclass.initComponent.call(this);
    }
});
